package com.kyivmohyla.kma2.client.events;

import com.google.gwt.event.shared.GwtEvent;
import com.kyivmohyla.kma2.client.utils.ExportOrder;

import java.util.List;

public class OrderExportEvent extends GwtEvent<OrderExportEventHandler> {
    public static Type<OrderExportEventHandler> TYPE = new Type<OrderExportEventHandler>();
    //    private final Map<String, String> exportOrder;
    private final List<ExportOrder> exportOrders;

    public OrderExportEvent(List<ExportOrder> exportOrders) {
//        this.exportOrder = new HashMap<String, String>();
//        this.exportOrder.putAll(exportOrder);
        this.exportOrders = exportOrders;
    }

    public List<ExportOrder> getExportOrders() {
        return exportOrders;
    }

    public Type<OrderExportEventHandler> getAssociatedType() {
        return TYPE;
    }

    protected void dispatch(OrderExportEventHandler handler) {
        handler.onOrderExport(this);
    }
}
